# ###################################
# This file is managed by puppet
# PLEASE DON'T MODIFY BY HAND
# ###################################

machine.project.location=/opt/codenvy-data/che-machines
che.workspace.logs=/opt/codenvy-data/che-machines-logs

# docker registry for snapshots
che.docker.registry=<%= scope.lookupvar('codenvy::docker_registry_for_workspace_snapshots') %>
# namespace for snapshots
che.docker.namespace=<%= scope.lookupvar('codenvy::docker_registry_namespace') %>
che.docker.cleanup_period_min=60

# swarm
docker.client.daemon_url=http://codenvy-swarm:2375
swarm.client.node_description_length=9

# wsagent
machine.ws_agent.run_command=<%= scope.lookupvar('codenvy::machine_ws_agent_run_command') %>
che.workspace.agent.dev.max_start_time_ms=<%= scope.lookupvar('codenvy::machine_ws_agent_max_start_time_ms') %>
che.workspace.agent.dev.ping_delay_ms=2000
che.workspace.agent.dev.ping_conn_timeout_ms=2000
che.workspace.agent.dev.ping_success_threshold=1
che.workspace.agent.dev.ping_timeout_error_msg=Timeout. The Che server is unable to ping your workspace. This implies a network configuration issue, workspace boot failure, or an unusually slow workspace boot.

machine.ws_agent.agent_api.path=/wsagent/ext/

# When Che start an agent, it performs check if it is launched.
che.agent.dev.max_start_time_ms=120000
che.agent.dev.ping_delay_ms=2000

router.nats.url=nats://localhost:4222
machine.router.routing_pattern=%4$s-%1$s.machines.<%= scope.lookupvar('codenvy::host_url') %>

# backup
machine.backup.backup_script=/opt/codenvy-data/conf/rsyncbackup.sh
machine.backup.restore_script=/opt/codenvy-data/conf/rsyncrestore.sh
machine.backup.backup_duration_second=300
machine.backup.restore_duration_second=300
machine.backup.backup_period_second=360

#cleanup workspace files
workspace.projects_storage.cleanup.script_path=/opt/codenvy-data/conf/cleanUpWorkspaceStorage.sh
workspace.projects_storage.cleanup.timeout_seconds=300

# machine default memory allocation
che.workspace.default_memory_mb=<%= scope.lookupvar('codenvy::machine_default_mem_size_mb') %>

# path to machine predefined recipes
local.recipe.path=

# extra hosts which will be used in machines
che.workspace.hosts=<%= scope.lookupvar('codenvy::machine_extra_hosts') %>
che.docker.tcp_connection_timeout_ms=600000
che.docker.tcp_connection_read_timeout_ms=600000
che.docker.always_pull_image=true
che.docker.api=1.20

# Handle https and port mapping by adding proxy on wsagent and terminal endpoints.
# string format arguments available are:
# %1 - Server reference
# %2 - Server location hostname
# %3 - Server location external port
# %4 - Server path (without leading slash if present)
# %5 - codenvy.host property (or "che.docker.ip.external" if this property is set)
machine.proxy_wsagent_server_url_template=<%= scope.lookupvar('codenvy::host_protocol') %>://%5$s/%3$s_%2$s/%4$s
machine.proxy_terminal_server_url_template=<%= scope.lookupvar('codenvy::host_protocol') %>://%5$s/%3$s_%2$s/%4$s


# If true, then all docker machines will start in privilege mode.
che.docker.privileged=<%= scope.lookupvar('codenvy::machine_docker_privileged') %>

# Security options
che.docker.securityopt=<%= scope.lookupvar('codenvy::machine_docker_securityopt') %>

# Allows to use registry for machine docker snapshots, you should set this property to {true},
# otherwise workspace snapshots would be saved locally.
che.docker.registry_for_snapshots=true

# docker network driver
che.docker.network_driver=<%= scope.lookupvar('codenvy::che_machine_docker_network_driver') %>

# Allows to adjust machine swap memory by multiplication current machnine memory on provided value.
# default is 0 which means disabled swap, if set multiplier value equal to 0.5 machine swap will be
# configured with size that equal to half of current machine memory.
che.docker.swap=<%= scope.lookupvar('codenvy::machine_docker_memory_swap_multiplier') %>

# java opts for dev machine
che.workspace.java.options=<%= scope.lookupvar('codenvy::workspace_java_options') %> <% if ! @http_proxy_for_codenvy_workspaces.empty? or ! @https_proxy_for_codenvy_workspaces.empty? -%>-Dhttp.proxySet=true<% end -%><% if ! @http_proxy_for_codenvy_workspaces.empty? -%><% if ! @http_proxy_for_codenvy_workspaces.empty? and @http_proxy_for_codenvy_workspaces.include? '@' -%> -Dhttp.proxyUser=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -Dhttp.proxyPassword=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -Dhttp.proxyHost=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -Dhttp.proxyPort=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %><% else -%> -Dhttp.proxyHost=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -Dhttp.proxyPort=<%= @http_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %><% end -%><% end -%><% if ! @https_proxy_for_codenvy_workspaces.empty? -%><% if @https_proxy_for_codenvy_workspaces.include? '@' -%> -Dhttps.proxyUser=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -Dhttps.proxyPassword=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -Dhttps.proxyHost=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -Dhttps.proxyPort=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %><% else -%> -Dhttps.proxyHost=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -Dhttps.proxyPort=<%= @https_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %><% end -%><% end -%><% if ! @no_proxy_for_codenvy_workspaces.empty? -%> -Dhttp.nonProxyHosts='<%= @no_proxy_for_codenvy_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(",").uniq.join("|") %>|'<% end -%>

# Maven command line options will be exported as value of MAVEN_OPTS
# environment variable in workspace dev-machine.
# If the value is not set then the value provided by 'che.workspace.java.options' property is used
che.workspace.maven.options=<%= scope.lookupvar('codenvy::workspace_maven_options') %>

# extra volumes to mount, semicolon separated.
che.workspace.volume=<%= scope.lookupvar('codenvy::machine_server_extra_volume') %>

# dns servers
che.dns.resolvers=<%= scope.lookupvar('codenvy::dns_resolvers') %>

# public key for rsync
workspace.backup.public_key_path=/opt/codenvy-data/conf/ssh/key.pem.pub

# Switches strategy of infrastructure provisioning for workspaces. Needed for switching between codenvy 'in-container' and 'native'.
codenvy.infrastructure=in-container

# do we need that ? check!
codenvy.workspace.projects_sync_port=0

# Limits the number of processes that can be forked inside a cgroup. Set -1 for unlimited.
# Since 4.3 kernel.
che.docker.pids_limit=512

# Whether to enable component that detects failures of a machine caused by unexpected container stop
che.docker.enable_container_stop_detector=true

# Sets parent cgroup for cgroups of containers created by workspaces.
# This allows an admin to set custom cgroup limitations to all containers of workspaces by configuring cgroups.
# Example:
# /my_group
# my_another_group
che.docker.parent_cgroup=<%= scope.lookupvar('codenvy::machine_docker_parent_cgroup') %>

# Sets set of CPUs that can be used by each container of started workspace.
# Example:
# 0-3
# 1,4
che.docker.cpuset_cpus=<%= scope.lookupvar('codenvy::machine_docker_cpuset_cpus') %>

# Next 2 properties set limits on CPU consumption by containers of started workspaces.
# Period sets amount of units per CPU core.
# Quota sets amount of units available for container per whole CPU.
# Max value of quota could be period * number of CPU cores in a system.
# Example:
# che.docker.cpu_period=5000
# che.docker.cpu_quota=10000
che.docker.cpu_period=<%= scope.lookupvar('codenvy::machine_docker_cpu_period') %>
che.docker.cpu_quota=<%= scope.lookupvar('codenvy::machine_docker_cpu_quota') %>

# Adds options when mounting the /projects volume.
che.docker.volumes_projects_options=Z

# Adds options when mounting the /mnt/che/terminal, /mnt/che/ws-agent.tar.gz, /mnt/che/conf volume
che.docker.volumes_agent_options=ro,Z

# Describes number of simultaneous container commits on the given node
che.docker.concurrent_commits_on_node=1

# Workspace threads pool configuration, this pool is used for workspace related
# operations that require asynchronous execution e.g. starting/stopping/snapshotting

# possible values are 'fixed', 'cached'
che.workspace.pool.type=fixed

# This property is ignored when pool type is different from 'fixed'.
# Configures the exact size of the pool, if it's set multiplier property is ignored.
# If this property is not set(0, < 0, NULL) then pool sized to number of cores,
#it can be modified within multiplier
che.workspace.pool.exact_size=NULL

# This property is ignored when pool type is different from 'fixed' or exact pool size is set.
# If it's set the pool size will be N_CORES * multiplier
che.workspace.pool.cores_multiplier=2
